UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GUaubKArfi+dTcBKZIBSbUxsSomfOQ+Z3mWqrIoxdMY=' 
WHERE 
  key_id = '82db5cdb8bbb96271ea276c615cc80feaf43f584e88cb1a5778408cd78c3c0e2' 
  AND (
    token = 'GUaubKArfi+dTcBKZIBSbUxsSomfOQ+Z3mWqrIoxdMY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030