UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4WhPEQoFCmYa39pTNj4Um30R3NfJts39lCIOrccrttE=' 
WHERE 
  key_id = 'f5338d6e43859ddb86b0b52e4e42cb9a6a76f4b125075d30174f3ea0432f3ef4' 
  AND (
    token = '4WhPEQoFCmYa39pTNj4Um30R3NfJts39lCIOrccrttE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027