UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qjztDbvFS6XMTCDV64Px1UhdE3iQwL948VT6j2O9z3Q=' 
WHERE 
  key_id = '2b927a66e431509aca67e689ab42f4096074314d85dd1ffa3d1f4a367a9d92c0' 
  AND (
    token = 'qjztDbvFS6XMTCDV64Px1UhdE3iQwL948VT6j2O9z3Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030