UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I+xZd7BH4Q06pPQh3ev7is22OhojgS8ylulmsDnPLso=' 
WHERE 
  key_id = 'a63362e86e3164b5f349ee53bbbea50edae592e42e950729a941e3d9dcee0803' 
  AND (
    token = 'I+xZd7BH4Q06pPQh3ev7is22OhojgS8ylulmsDnPLso=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029