UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CPPmKOfJQ5dYAXvBiowZYAl6Cqtf/3t9M0jQf0fmu3I=' 
WHERE 
  key_id = '3424366cbf5f646f71358dbfb7d686f82b4d508a2580afa5da47eff1560a6380' 
  AND (
    token = 'CPPmKOfJQ5dYAXvBiowZYAl6Cqtf/3t9M0jQf0fmu3I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037