UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CzT4/0RXyxNxgXI6a4L7mXDDKBeySQFqs6ER2O15sGg=' 
WHERE 
  key_id = 'dfc6cdd2a969b26cd4662f5b0cd78a56a615510c3f7afda1c01865fc9ea9d8f9' 
  AND (
    token = 'CzT4/0RXyxNxgXI6a4L7mXDDKBeySQFqs6ER2O15sGg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041