UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LiBHb6cgHGfwv+CsoLLiFFWFHSzXTMpNv7H2Yrz2n8g=' 
WHERE 
  key_id = '081f813625124c37b210da5dc2e251fd93ddd49c4cb6b6d0fb7c43e24d5a53b3' 
  AND (
    token = 'LiBHb6cgHGfwv+CsoLLiFFWFHSzXTMpNv7H2Yrz2n8g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036