UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2NeL25o9zZ4Okxk0KNg/Ie+ZJFwZ90+mka3VdpMa8YI=' 
WHERE 
  key_id = '40448d74f003be681974dc2635e84a20d2547157fd20d57bf667073e7660abe1' 
  AND (
    token = '2NeL25o9zZ4Okxk0KNg/Ie+ZJFwZ90+mka3VdpMa8YI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022