UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2PkwzKhwCAOnHiedDDpYq9NScZRTaJDVl0/p0XQwOaU=' 
WHERE 
  key_id = '6d4be79df9fd5005d7f522e07ef607b35be3409723e6d86743158e30c750d289' 
  AND (
    token = '2PkwzKhwCAOnHiedDDpYq9NScZRTaJDVl0/p0XQwOaU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048