UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H+MQisuv0K7Ss6mCwzgGA6JPlLFSewWD1Ka95OHYLDE=' 
WHERE 
  key_id = 'e9a2e46ced28b03016dc3ed4172d8debdd66194b0ce1e76f19fb52e2cb8eb574' 
  AND (
    token = 'H+MQisuv0K7Ss6mCwzgGA6JPlLFSewWD1Ka95OHYLDE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045