UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '96e07Hi7aI007Th8u+0BT1qcvBsYkkvS0RlcziEFF14=' 
WHERE 
  key_id = 'b650d38f4d3d196eb0c04deb2726bbc476cf0e731c335da007c0cb58e77a2483' 
  AND (
    token = '96e07Hi7aI007Th8u+0BT1qcvBsYkkvS0RlcziEFF14=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031