UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3UHx6HNQmctroUL0t7JxBJvk9JevY5uIPxt/PLmhSPI=' 
WHERE 
  key_id = 'f321d227e3cfa6dabf1fa3f8566fcabbaaeb8021a2bb1e83cfb611cf9291743c' 
  AND (
    token = '3UHx6HNQmctroUL0t7JxBJvk9JevY5uIPxt/PLmhSPI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061