UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bvUmdHbq2ZeJbHuQmd0//Ceson21M2o1COiDrSl2TkI=' 
WHERE 
  key_id = '016d37bc86ed004a752ac386387dc3e8994d4d8d7569ca74f8a9d1444fcc0579' 
  AND (
    token = 'bvUmdHbq2ZeJbHuQmd0//Ceson21M2o1COiDrSl2TkI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024