UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'akSKopZKFyfHQZEGX+RAbikrmqLsKC0uj0t0g/ZEhns=' 
WHERE 
  key_id = '16f785dc0b74deea111a4a07491d0791a62ffd10030d556c6970e37cd88d041d' 
  AND (
    token = 'akSKopZKFyfHQZEGX+RAbikrmqLsKC0uj0t0g/ZEhns=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043