UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3l3xAzLLA3U589z1jlC6JGLBwSVsCsbYinbCsTo2H6o=' 
WHERE 
  key_id = '0b7e02ed957322044bf4865f21dc99c0e5e836917a705f089f93a4879a91c3ef' 
  AND (
    token = '3l3xAzLLA3U589z1jlC6JGLBwSVsCsbYinbCsTo2H6o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036