UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ssjq/FdSjTWcJe+lcBFZ4zsVtydiwi9dWwpWmuB2aW0=' 
WHERE 
  key_id = 'fee7e0bdfaa578ef438f8d9467a2c120007646deda60a89d01f76c5dc5817c96' 
  AND (
    token = 'Ssjq/FdSjTWcJe+lcBFZ4zsVtydiwi9dWwpWmuB2aW0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034