UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zpvEaAyTBtzzei42QcP2tT+VWakAFfFFjfJh9gmOl2c=' 
WHERE 
  key_id = 'b1d62328161f945a0655316bba150a546f8e6d952c6d0921bc176f5918b91fa7' 
  AND (
    token = 'zpvEaAyTBtzzei42QcP2tT+VWakAFfFFjfJh9gmOl2c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030