UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'W9BkwgmOD0Z9LtznqplDYqpusBkBOAQIjxeD4cT9i4w=' 
WHERE 
  key_id = '9dc39f6c3ae9efb412431f58135e1cea087ffb6d72e03815090d6ac7c8158255' 
  AND (
    token = 'W9BkwgmOD0Z9LtznqplDYqpusBkBOAQIjxeD4cT9i4w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033