UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v4Qxanrcpe9RaqaV55gcn7pWCgKEhsqHR0AQB1/VMm4=' 
WHERE 
  key_id = '225ab76543e72a405276b39781884bd148a5ae4bb8f2cc6a481e8073f293ee54' 
  AND (
    token = 'v4Qxanrcpe9RaqaV55gcn7pWCgKEhsqHR0AQB1/VMm4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017