UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xwwQ6iWyqxuu7SZBu6qZjWYruql+hyK7zxQDcIpMjS8=' 
WHERE 
  key_id = '5a31721ee642a5d5771a905ae2e03fe40ee756202dc9221363c784641ef1e24d' 
  AND (
    token = 'xwwQ6iWyqxuu7SZBu6qZjWYruql+hyK7zxQDcIpMjS8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00063