UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'soQdk4vvPBz/YU6rsrwAlNhuX8MX99SK4nNep12w9RE=' 
WHERE 
  key_id = '60c3dc29951c3c2eb2ffe339757479379005d47d4d3cc7aac7593fbb7081ce7d' 
  AND (
    token = 'soQdk4vvPBz/YU6rsrwAlNhuX8MX99SK4nNep12w9RE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028