UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9KBFrCumqgPeaSg6VkC+rQ7c1t49do8YJdvwVLpSbFE=' 
WHERE 
  key_id = '93cf0e2b1167754d7c99831b73201de14adb23d20d56a85a0975b858fa11b42b' 
  AND (
    token = '9KBFrCumqgPeaSg6VkC+rQ7c1t49do8YJdvwVLpSbFE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029