UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ibdyKxvm4iWkCjiiaIxVC+zOsWQr7Ti64tePIZxLNXA=' 
WHERE 
  key_id = '941d0e92e3784b8e1ff5ee7477bf957ae255a38196222b4d5a0c1eb1ec9c3aaf' 
  AND (
    token = 'ibdyKxvm4iWkCjiiaIxVC+zOsWQr7Ti64tePIZxLNXA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035