UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3vyTSJeV7nOZ6d7/vBloHlRIe97WI7R41HARyrdRv6g=' 
WHERE 
  key_id = '56952d782136caf7e3ec29c54de13f9acc65d1b269c3d1c8eed82ff35be67b82' 
  AND (
    token = '3vyTSJeV7nOZ6d7/vBloHlRIe97WI7R41HARyrdRv6g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032