UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TAVESCuZONFimZ26IIpnLaF80CoHv0hgAHcrUdzH7/w=' 
WHERE 
  key_id = '9785f5d4e162f354d58fb446b83cdc555c94bef0ced7ddaa87920afc8b6a8cea' 
  AND (
    token = 'TAVESCuZONFimZ26IIpnLaF80CoHv0hgAHcrUdzH7/w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021