UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '94RSW38/c4jkv1hxFfBM6+oWs7D2tZpJELAIPyNAzhk=' 
WHERE 
  key_id = 'cc2506d87608dd634bca359863347dab8f8feadd80a28b93c56160847dc5b3f7' 
  AND (
    token = '94RSW38/c4jkv1hxFfBM6+oWs7D2tZpJELAIPyNAzhk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032