UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'W001wSEXW72B7mifArLqIrC7oW7W5IAqH/ItBDh0E1A=' 
WHERE 
  key_id = 'e5add429648ac0887d68a7c0a9ac42e22e60d656ef5c15280b0438a6800a7479' 
  AND (
    token = 'W001wSEXW72B7mifArLqIrC7oW7W5IAqH/ItBDh0E1A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039