UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '42APh/203lsECe8QeCcZuZr2U13gNzMK7meb5T0SFCk=' 
WHERE 
  key_id = '4f2ff96f93e01d92985340ce60f76fe0ebb85fa934594722f4aeb316da17e1e1' 
  AND (
    token = '42APh/203lsECe8QeCcZuZr2U13gNzMK7meb5T0SFCk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035