UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6eo3sj40KoVjlAfmi4qo8dIk60VyWllZLb+yT1DZvJA=' 
WHERE 
  key_id = '170f3bd99be73958d97dd714807cc7a26fece43b838465c3cdea0a82a00f6be9' 
  AND (
    token = '6eo3sj40KoVjlAfmi4qo8dIk60VyWllZLb+yT1DZvJA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028