UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hBslumgbrV3gvnrjfdEzgmvRitu2Z3NAgk3QP02f1iw=' 
WHERE 
  key_id = 'eae0b429b2860f252ef4d813f4dcd07408301612c06c6bc84ab59510db60dcc9' 
  AND (
    token = 'hBslumgbrV3gvnrjfdEzgmvRitu2Z3NAgk3QP02f1iw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031