UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Tf1w3Xcu9tszbckeZqBXaNl+xuJ0EaA2B24kq7m3QZ8=' 
WHERE 
  key_id = 'ffbfacadeaef58c6cde5cc09d3ae7a4a74d8a90e96c6a038959b8df7a7cdf353' 
  AND (
    token = 'Tf1w3Xcu9tszbckeZqBXaNl+xuJ0EaA2B24kq7m3QZ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036