UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Lk/4UsrlFO6Jqs6K0vVBOeYJ4468+0W7KV0m2lAmG5k=' 
WHERE 
  key_id = 'e2383c4f67d71c3f59e40c88df0267cfccfd127a92c7903e255a5f06ae7c469b' 
  AND (
    token = 'Lk/4UsrlFO6Jqs6K0vVBOeYJ4468+0W7KV0m2lAmG5k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029