UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LzqsHPRJD+gonngEewvPss/LE6yHUaMn8+fpXM2Bdls=' 
WHERE 
  key_id = '7e56b23f2c2b1adddb1eac1140bbb2efa8fa585e0489431ec59621f136d8c130' 
  AND (
    token = 'LzqsHPRJD+gonngEewvPss/LE6yHUaMn8+fpXM2Bdls=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026