UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PYQAD6JmK0NtA7pWv+vI7fKavw6YaI+89idod4EvlGE=' 
WHERE 
  key_id = '053db6a30947d99ea1d3d1971a20295ce3b28b2adcb5fc1b0b0f5777c9d3b806' 
  AND (
    token = 'PYQAD6JmK0NtA7pWv+vI7fKavw6YaI+89idod4EvlGE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030