UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qMx+KnYB5jpUooKpDaQ5oJs01bUy28zipXZevBgIrnE=' 
WHERE 
  key_id = '736cc0d8a3f771f0398a5689f22ccd4114c3088a8d8c4a4beff0995826a8bb5d' 
  AND (
    token = 'qMx+KnYB5jpUooKpDaQ5oJs01bUy28zipXZevBgIrnE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040