UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3+9+fSAo3M2+qOTxvyDrIk/lq8iX3QnWg1wouJOFGlk=' 
WHERE 
  key_id = '83fa4ad57befeb809e7e5d565daef75370a10e69fa9e99e2f59da52ed437b13c' 
  AND (
    token = '3+9+fSAo3M2+qOTxvyDrIk/lq8iX3QnWg1wouJOFGlk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028