UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ur7j+DrL3+HP7AVTj8Xy2G6/5adGVF7RpE2LXogn7Vo=' 
WHERE 
  key_id = 'eebee8215fa5bd63ba3ad97b0867bc30cd8c3237c74cd5bfe120932eabfdf1ae' 
  AND (
    token = 'Ur7j+DrL3+HP7AVTj8Xy2G6/5adGVF7RpE2LXogn7Vo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036