UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2fkdI8jQZ0spo/lzfK+7S/H8f4wXp1FNYiVqFnuQB0g=' 
WHERE 
  key_id = 'aa8178ca6cb65492205943be71aa1f75fc8f1fcd203029c2a047c0c410087263' 
  AND (
    token = '2fkdI8jQZ0spo/lzfK+7S/H8f4wXp1FNYiVqFnuQB0g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043