UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ipBwH6ZiJC2iQfMQ/mpguldg8X+iaUelkADFTqTPDWo=' 
WHERE 
  key_id = 'b305b09b6ba5e1d76e2f096d4737f77b78bd8f46d554cbe905a86af451ba1022' 
  AND (
    token = 'ipBwH6ZiJC2iQfMQ/mpguldg8X+iaUelkADFTqTPDWo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028