UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jvoCrSOWr2pX+aQbu2JN+ixiWaO7Ng+o2j4toQKn2P4=' 
WHERE 
  key_id = '178efa5879ad09ab470f6fa8df2b35e6a330513fe13732a7b07bbb92e7a2cb68' 
  AND (
    token = 'jvoCrSOWr2pX+aQbu2JN+ixiWaO7Ng+o2j4toQKn2P4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00085