UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uzJXHOvnHu/M/bbo+FR82o4/HmbPrYl6mPpKRwnMAqk=' 
WHERE 
  key_id = '8bfdd338bffba77e45ba14d5a33113b4603428b3dbba0147605f53da37762de1' 
  AND (
    token = 'uzJXHOvnHu/M/bbo+FR82o4/HmbPrYl6mPpKRwnMAqk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043