UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z5J9dpIfSVe9w4Sj+YY7l2BNr4JhNfKsoCvQvSMtKfU=' 
WHERE 
  key_id = 'fb999debe6fc3f129f8bfae3d8a5d1179899b2ab8d64c62a0460acbcf791a2f6' 
  AND (
    token = 'z5J9dpIfSVe9w4Sj+YY7l2BNr4JhNfKsoCvQvSMtKfU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045